(function ($) {
	$.analysis = {
			columnChart : function(chartDiv, title, xAxisArray, yAxisTitle,  waitingDataArray, safeDataArray, virusDataArray, otherDataArray, totalDataArray){
				$(chartDiv).highcharts({
					chart: {
		            },
		            title: {
		                text: title
		            },
		            xAxis: {
		                categories: xAxisArray
		            },
		            yAxis: {
		                min: 0,
		                title: {
		                    text: yAxisTitle
		                }
		            },
		            tooltip: {
		            	pointFormat:'{series.name}: {point.y}个'
		            },
		            series: [{
		                type: 'column',
		                name: 'waiting',//等待返回结果的
		                color:Highcharts.getOptions().colors[4],
		                data: waitingDataArray
		            }, {
		                type: 'column',
		                name: 'safe',//安全
		                color:Highcharts.getOptions().colors[2],
		                data: safeDataArray
		            }, {
		                type: 'column',
		                name: 'virus',//有病毒的
		                color:Highcharts.getOptions().colors[8],
		                data: virusDataArray
		            }, {
		                type: 'column',
		                name: 'other',//其他结果
		                color:Highcharts.getOptions().colors[5],
		                data: otherDataArray
		            },{
		                type: 'spline',
		                name: 'total',
		                data: totalDataArray,
		                marker: {
		                	lineWidth: 2,
		                	lineColor: Highcharts.getOptions().colors[3],
		                	fillColor: 'white'
		                }
		            }]
		        });
			},
			splineChart : function(chartDiv, title, xAxisArray, yAxisTitle,  waitingDataArray, safeDataArray, virusDataArray, otherDataArray, totalDataArray){
				$(chartDiv).highcharts({
		            chart: {
		                type: 'spline'
		            },
		            title: {
		                text: title
		            },
		            xAxis: {
		                categories: xAxisArray
		            },
		            yAxis: {
		                title: {
		                    text: yAxisTitle
		                },
		                labels: {
		                    formatter: function() {
		                        return this.value +'个';
		                    }
		                }
		            },
		            tooltip: {
		                crosshairs: true,
		                shared: true
		            },
		            plotOptions: {
		                spline: {
		                    marker: {
		                        radius: 4,
		                        lineColor: '#666666',
		                        lineWidth: 1
		                    }
		                }
		            },
		            series: [{
		                name: 'total',                
		                data: totalDataArray
		            },{
		                name: 'waiting',
		                data: waitingDataArray
		    
		            },{
		                name: 'safe',
		                data: safeDataArray
		    
		            },{
		                name: 'virus',
		                data: virusDataArray
		    
		            },{
		                name: 'other',
		                data: otherDataArray
		    
		            }]
		        });
			}
	};
})(jQuery);
